#include <iostream>
#include <time.h>
#include <unistd.h>
#include <memory>
#include "Thread.hpp"
using namespace std;

class MyThread
: public Thread
{
public:
    void run() override{
        srand(time(nullptr));
        int count = 10;
        while(count--){
            int number = rand() % 100;
            printf("number is [%d].\n", number);
            sleep(1);
        }
    }
};

int main(){
    unique_ptr<Thread> pth(new MyThread);
    pth->start();
    pth->join();
    printf("Main thread is exiting.\n");
    return 0;
}